package com.wzk.travelspringboot.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wzk.travelspringboot.dto.OrderPayDTO;
import com.wzk.travelspringboot.dto.Result;
import com.wzk.travelspringboot.dto.TicketOrderDTO;
import com.wzk.travelspringboot.entity.TicketOrder;
import com.wzk.travelspringboot.vo.ScenicOrderVO;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author: WangZiKang
 * @Date: 2025/1/19 16:19
 */
public interface TicketOrderService extends IService<TicketOrder> {
    Result createOrder(TicketOrderDTO dto);

    Result changeOrderStatus(OrderPayDTO dto);

    Result queryOrderByUserId(Long aLong);

    Result cancelOrder(@NotBlank(message = "订单号不能为空") String orderNumber);

    Result usedTicket(@NotBlank(message = "核销的订单号不能为空") String on);

    Result searchTicketOrder(com.wzk.travelspringboot.controller.admin.dto.TicketOrderDTO dto);
    
    /**
     * 分页查询订单并关联景区名称
     * @param pageNum 页码
     * @param pageSize 每页大小
     * @return 带有景区名称的订单列表
     */
    Result queryOrdersWithScenicName(Integer pageNum, Integer pageSize);
    
    /**
     * 将TicketOrder对象转换为ScenicOrderVO对象，并关联查询景区名称
     * @param order 订单对象
     * @return 包含景区名称的订单VO对象
     */
    ScenicOrderVO convertToVO(TicketOrder order);
}
